package cn.micai.base;

import com.alibaba.fastjson.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * 描述：
 * <p>
 *
 * @author: 赵新国
 * @date: 2018/4/13 11:53
 */
public class DeptTreeTest {

    public static void main(String[] args){
        DeptTree deptTree = new DeptTree();
        deptTree.setId("1001");
        deptTree.setParentId("0");
        DeptTree deptTree1 = new DeptTree();
        deptTree1.setId("1002");
        deptTree1.setParentId("1001");
        DeptTree deptTree2 = new DeptTree();
        deptTree2.setId("1003");
        deptTree2.setParentId("1002");

        List<DeptTree> deptTreeList = new ArrayList<>();
        deptTreeList.add(deptTree);
        deptTreeList.add(deptTree1);
        deptTreeList.add(deptTree2);

        DeptTreeService deptTreeService = new DeptTreeService();
        List childTreeObjects = deptTreeService.getDeptTree(deptTreeList, "0");
        System.out.println(JSONObject.toJSON(childTreeObjects));

    }
}
